// 调用后端接口地址
import { API_CONFIG } from "../config/index.js";
import request from '../api/index.js'

export const getUserListHandler = () => {
    return request(API_CONFIG.getUserListApi, {}, "get", 2000)
}

export const deleteUserHandler = (id) => {
    console.log("删除用户::", id)
    return request(API_CONFIG.deleteUserApi, {id}, "get", 1000)
}

export const addUserHandler = (userFrom) => {
    console.log("添加用户:",userFrom)
    return request(API_CONFIG.addUserApi, {userFrom}, "post", 1000)
}

export const updateUserHandler = (userFrom) => {
    console.log("更新用户:",userFrom)
    return request(API_CONFIG.updateUserApi, {userFrom}, "post", 1000)
}